<?php
//

function categories($top="",$twolevels=false,$admin=false)
{
global $site_output,$forum_cat,$cnt;
if (!$twolevels){$site_output=topics_start($top);}
for ($i=1;$i<=$cnt;$i++)
{
if($twolevels){
if ($forum_cat[$i]['parent']==$top && isset($forum_cat[$i])){
$site_output=$site_output.main_category_start($forum_cat[$i]);
if ($twolevels){
for ($j=1;$j<=$cnt;$j++)
{if ($forum_cat[$j]['parent']==$forum_cat[$i]['uid'] && $forum_cat[$j]['parent']!=""){
$site_output=$site_output.main_sub($forum_cat[$j]);
}}}
$site_output=$site_output.main_category_end($forum_cat[$i]);
}}else{


if ($forum_cat[$i]['parent']==$top ){
$site_output=$site_output.topics($forum_cat[$i]);
}






}}
if (!$twolevels){$site_output=$site_output.topics_end($top);}
}
//


?>